package com.syzsn.common.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
@Api(value = "hello", tags={"Hello SpringBoot"})
public class HelloController {

    @Value("${application.message:Hello World}")
    private String message = "Hello World";

    @ApiOperation(value = "hello")
    @GetMapping("/hello")
    public ModelAndView hello(ModelMap model){
        return new ModelAndView("hello");
    }

    @ApiOperation(value = "index")
    @GetMapping({"/index", "/"})
    public ModelAndView index(ModelMap model){
        return new ModelAndView("index");
    }
}
